<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/AW-LICENSE.txt
 *
 * =================================================================
 *                 MAGENTO EDITION USAGE NOTICE
 * =================================================================
 * This package designed for Magento community edition
 * aheadWorks does not guarantee correct work of this extension
 * on any other Magento edition except Magento community edition.
 * aheadWorks does not provide extension support in case of
 * incorrect edition usage.
 * =================================================================
 *
 * @category   AW
 * @package    AW_Blog
 * @version    1.2.1
 * @copyright  Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/AW-LICENSE.txt
 */
?> 
<?php $posts = $this->getPosts(); ?>
<div id="messages_product_view">
    <?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?> 
    <?php echo Mage::app()->getLayout()->getMessagesBlock()->getGroupedHtml(); ?> 
</div>
<!--div id="blog-toolbar">
 <?php //echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>
 </div-->
<ol id="blog-list" class="products-list">
<?php
 foreach ($posts as $post): ?>
    <li class="postWrapper item">
		<div class="item-inner">

			<div class="product-info">
				<div class="product-name">
					<h2><a class="title-blog-name" href="<?php echo $post->getAddress(); ?>" ><?php echo $post->getTitle(); ?></a></h2>
					<!--<h3><?php echo $post->getCreatedTime(); ?></h3>-->
				</div>
				
				<div class="info-cat-blog">
					<?php echo $post->getCreatedTime();?>
					<!--
					<?php $postCats = $post->getCats(); ?>
					<?php if (!empty($postCats)): ?>
						<?php echo Mage::helper('blog')->__('Category:'); ?>
						<?php foreach ($postCats as $data): ?>               
							<a class="cat-title" href="<?php echo $data['url']; ?>"><?php echo $data['title']; ?></a> 
						<?php endforeach; ?> 
					<?php else: ?>
						<?php echo Mage::helper('blog')->__('Posted'); ?>
					<?php endif; ?>
					-->
				</div>
					
					<div class="postContent">
						<?php echo $post->getPostContent(); ?>
						<div class="bottom-info-blog">
							<ul class="list-info-bottom">
								<li>
									<?php if ($this->getCommentsEnabled()): ?>
										<a class="link-comment" href="<?php echo $post->getAddress(); ?>#commentBox" ><?php echo $post->getCommentCount(); ?> <?php if($post->getCommentCount()<=1) echo $this->__('Comment'); ?>  <?php if($post->getCommentCount()>1) echo $this->__('Comments'); ?></a>
									<?php endif; ?>
								</li>
								<li>&nbsp;|&nbsp;</li>
								<li>
									<?php echo $this->__("Posted By:"); ?> <span class="user-wr"><?php echo $post->getUser(); ?></span>
								</li>
							</ul>
						</div>
						
					</div>
					
			</div>
				

				<?php // echo $this->getBookmarkHtml($post) ?>
				<!--
				<div class="tags"><?php echo $this->getTagsHtml($post) ?></div>
				-->
		</div>
    </li>
<?php endforeach; ?>
</ol> 
<div class="toolbar-bottom toolbar-cat">
 <?php echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>
 </div>
<?php //echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>
<?php //$this->getPages(); ?>
